import { PropEditor, PropEditorState } from "maishu-jueying";
import React = require("react");
import { PropertiesComponent } from "./properties";
import tips from "tips";

export class FieldsEditor extends PropEditor<PropEditorState<Product["Fields"]>, Product["Fields"]>{
    render() {
        let { value } = this.props;
        return <PropertiesComponent name="商品规格" properties={value} emptyText={tips.noProductRegular}
            changed={e => {
                this.props.updateComponentProp(e);
            }} />
    }
}

export class ArgumentsEditor extends PropEditor<PropEditorState<Product["Arguments"]>, Product["Arguments"]>{
    render() {
        let { value } = this.props;
        return <PropertiesComponent name="商品参数" properties={value} emptyText={tips.noProductRegular}
            changed={e => {
                this.props.updateComponentProp(e);
            }} />
    }
}